package com.tfswx.jcyw.ruleenginedesigner.config;

import com.tfswx.jcyw.ruleenginedesigner.filter.ReauestLogFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Ricky
 * @date 2020/12/17
 */
@Configuration
public class FilterConfig {
    @Bean
    public FilterRegistrationBean<ReauestLogFilter> registFilter() {
        FilterRegistrationBean<ReauestLogFilter> registration = new FilterRegistrationBean<>();
        registration.setFilter(new ReauestLogFilter());
        registration.addUrlPatterns("/*");
        registration.setName("requestLogFilter");
        registration.setOrder(1);
        return registration;
    }
}
